/************************************************************************
                        AcademicTime.h.cpp - Copyright asaf
*/
#include "AcademicTime.h"
// Constructors/Destructors
AcademicTime::~AcademicTime (){}
//getter/setter
void AcademicTime::setStartingHour ( int new_var ){m_StartingHour = new_var;}
int AcademicTime::getStartingHour (){return m_StartingHour;}
const int AcademicTime::getStartingHour ( ) const{return m_StartingHour;}
void AcademicTime::setEndingHour ( int new_var ){m_EndingHour = new_var;}
int AcademicTime::getEndingHour ( ){return m_EndingHour;}
const int AcademicTime::getEndingHour ( ) const{return m_EndingHour;}
void AcademicTime::setSemester ( int new_var ) {m_Semester = new_var;}
int AcademicTime::getSemester ( ) {return m_Semester;}
const int AcademicTime::getSemester ( ) const{	return m_Semester;}
void AcademicTime::setWeekday ( int new_var ) {	m_Weekday = new_var;}
int AcademicTime::getWeekday ( ) {	return m_Weekday;}
const int AcademicTime::getWeekday ( ) const{return m_Weekday;}
//methods
bool AcademicTime::isAcademicTimeOverlapping(const AcademicTime &time)
{
	if (((m_Weekday>0)&&(time.m_Weekday>0)&&
		(time.m_Semester==m_Semester)&&(time.m_Weekday==m_Weekday))&&
		((intBetween(time.m_StartingHour,m_StartingHour-1,m_EndingHour+1))||
		(intBetween(time.m_EndingHour,m_StartingHour-1,m_EndingHour+1))))return true;
	return false;
}

bool AcademicTime::isAcademicTimeOverlapping(const int startHour,int endHour,int semester,int weekday)
{
	if ((semester==m_Semester)&&(weekday==m_Weekday)&&
		((intBetween(startHour,m_StartingHour,m_EndingHour))||
		(intBetween(endHour,m_StartingHour,m_EndingHour))))return true;
	return false;
}
const bool AcademicTime::isEmpty() const
{
	return ((m_Semester==0)&&(m_Weekday==0)&&(m_StartingHour==0)&&(m_EndingHour==0));
}